<template>
    <div id="app">
        <router-view />
    </div>
</template>

<script>
export default {
    name: "App",
    data() {
        return {
            screenWidth: 0,
        }
    },
    mounted() {
        const that = this;
        //监听屏幕宽度变化
        window.addEventListener("resize", function () {
            return (() => {
                that.getScreenWidth()
            })();
        });
        that.getScreenWidth()
    },
    methods: {
        getScreenWidth() {
            this.screenWidth = document.body.clientWidth;
            if (this.screenWidth <= 1024) {
                this.$store.commit('SET_MOBILE_VAL', true);
            } else {
                this.$store.commit('SET_MOBILE_VAL', false);
            }
        }
    },
};
</script>

<style>
@import "../static/css/global.css";
:root {
    --main-color: #2473f4;
}
/* 商品导入提示信息需要全部展示，因此再次修改样式 */
.el-message {
    max-height: 80vh;
    overflow: auto;
}
.el-notification {
    max-height: 80vh;
    overflow: auto;
    width: 400px;
}
</style>